package com.zyq.service.impl;

import com.zyq.model.entity.RiskLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zyq.mapper.RiskLevelMapper;
import com.zyq.service.IRiskLevelService;

import java.util.List;

/**
 * 风险等级Service业务层处理
 *
 * @author zyq
 * @date 2021-12-09
 */
@Service
public class RiskLevelServiceImpl implements IRiskLevelService
{
    @Autowired
    private RiskLevelMapper riskLevelMapper;

    /**
     * 查询风险等级
     *
     * @param id 风险等级ID
     * @return 风险等级
     */
    @Override
    public RiskLevel selectRiskLevelById(Long id)
    {
        return riskLevelMapper.selectRiskLevelById(id);
    }

    /**
     * 查询风险等级列表
     *
     * @return 风险等级
     */
    @Override
    public List<RiskLevel> selectRiskLevelList()
    {
        return riskLevelMapper.selectRiskLevelList();
    }

    /**
     * 新增风险等级
     *
     * @param riskLevel 风险等级
     * @return 结果
     */
    @Override
    public int insertRiskLevel(RiskLevel riskLevel)
    {
        return riskLevelMapper.insertRiskLevel(riskLevel);
    }

    /**
     * 修改风险等级
     *
     * @param riskLevel 风险等级
     * @return 结果
     */
    @Override
    public int updateRiskLevel(RiskLevel riskLevel)
    {
        return riskLevelMapper.updateRiskLevel(riskLevel);
    }

    /**
     * 批量删除风险等级
     *
     * @param ids 需要删除的风险等级ID
     * @return 结果
     */
    @Override
    public int deleteRiskLevelByIds(Long[] ids)
    {
        return riskLevelMapper.deleteRiskLevelByIds(ids);
    }

    /**
     * 删除风险等级信息
     *
     * @param id 风险等级ID
     * @return 结果
     */
    @Override
    public int deleteRiskLevelById(Long id)
    {
        return riskLevelMapper.deleteRiskLevelById(id);
    }
}
